From 181841cbe9a73c0fef6a6505f6d74446327a5204 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Wed, 11 Jun 2008 16:57:42 +0900 Subject: [PATCH] [IA64] efi: remove old efi code to copmile newer linux acpi code. Signed-off-by: Isaku Yamahata --- xen/arch/ia64/linux-xen/efi.c | 26 ---------------------- xen/arch/ia64/xen/dom_fw_dom0.c | 20 ++++++++--------- xen/arch/ia64/xen/pcdp.c | 13 +++++++++++ xen/arch/ia64/xen/xensetup.c | 3 ++- xen/include/asm-ia64/linux-xen/linux/efi.h | 11 --------- 5 files changed, 25 insertions(+), 48 deletions(-) diff --git a/xen/arch/ia64/linux-xen/efi.c b/xen/arch/ia64/linux-xen/efi.c index ecc64f730e..3eebc229dd 100644 --- a/xen/arch/ia64/linux-xen/efi.c +++ b/xen/arch/ia64/linux-xen/efi.c @@ -504,7 +504,6 @@ efi_init (void) printk(KERN_INFO "EFI v%u.%.02u by %s:", efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor); -#ifndef XEN efi.mps = EFI_INVALID_TABLE_ADDR; efi.acpi = EFI_INVALID_TABLE_ADDR; efi.acpi20 = EFI_INVALID_TABLE_ADDR; @@ -535,31 +534,6 @@ efi_init (void) printk(" HCDP=0x%lx", config_tables[i].table); } } -#else - /* Members of efi are set with virtual address in old linux code. - The latest linux set wiht physicall address. */ - for (i = 0; i < (int) efi.systab->nr_tables; i++) { - if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) { - efi.mps = __va(config_tables[i].table); - printk(" MPS=0x%lx", config_tables[i].table); - } else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) { - efi.acpi20 = __va(config_tables[i].table); - printk(" ACPI 2.0=0x%lx", config_tables[i].table); - } else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) { - efi.acpi = __va(config_tables[i].table); - printk(" ACPI=0x%lx", config_tables[i].table); - } else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) { - efi.smbios = __va(config_tables[i].table); - printk(" SMBIOS=0x%lx", config_tables[i].table); - } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) { - efi.sal_systab = __va(config_tables[i].table); - printk(" SALsystab=0x%lx", config_tables[i].table); - } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) { - efi.hcdp = __va(config_tables[i].table); - printk(" HCDP=0x%lx", config_tables[i].table); - } - } -#endif printk("\n"); runtime = __va(efi.systab->runtime); diff --git a/xen/arch/ia64/xen/dom_fw_dom0.c b/xen/arch/ia64/xen/dom_fw_dom0.c index 18ba4ebfc3..43ca7908a1 100644 --- a/xen/arch/ia64/xen/dom_fw_dom0.c +++ b/xen/arch/ia64/xen/dom_fw_dom0.c @@ -212,33 +212,33 @@ void __init efi_systable_init_dom0(struct fw_tables *tables) /* Write messages to the console. */ printk("Domain0 EFI passthrough:"); - if (efi.mps) { + if (efi.mps != EFI_INVALID_TABLE_ADDR) { tables->efi_tables[i].guid = MPS_TABLE_GUID; - tables->efi_tables[i].table = __pa(efi.mps); + tables->efi_tables[i].table = efi.mps; printk(" MPS=0x%lx", tables->efi_tables[i].table); i++; } - if (efi.acpi20) { + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) { tables->efi_tables[i].guid = ACPI_20_TABLE_GUID; - tables->efi_tables[i].table = __pa(efi.acpi20); + tables->efi_tables[i].table = efi.acpi20; printk(" ACPI 2.0=0x%lx", tables->efi_tables[i].table); i++; } - if (efi.acpi) { + if (efi.acpi != EFI_INVALID_TABLE_ADDR) { tables->efi_tables[i].guid = ACPI_TABLE_GUID; - tables->efi_tables[i].table = __pa(efi.acpi); + tables->efi_tables[i].table = efi.acpi; printk(" ACPI=0x%lx", tables->efi_tables[i].table); i++; } - if (efi.smbios) { + if (efi.smbios != EFI_INVALID_TABLE_ADDR) { tables->efi_tables[i].guid = SMBIOS_TABLE_GUID; - tables->efi_tables[i].table = __pa(efi.smbios); + tables->efi_tables[i].table = efi.smbios; printk(" SMBIOS=0x%lx", tables->efi_tables[i].table); i++; } - if (efi.hcdp) { + if (efi.hcdp != EFI_INVALID_TABLE_ADDR) { tables->efi_tables[i].guid = HCDP_TABLE_GUID; - tables->efi_tables[i].table = __pa(efi.hcdp); + tables->efi_tables[i].table = efi.hcdp; printk(" HCDP=0x%lx", tables->efi_tables[i].table); i++; } diff --git a/xen/arch/ia64/xen/pcdp.c b/xen/arch/ia64/xen/pcdp.c index b785179266..102f2c4e3e 100644 --- a/xen/arch/ia64/xen/pcdp.c +++ b/xen/arch/ia64/xen/pcdp.c @@ -146,10 +146,17 @@ setup_serial_console(struct pcdp_uart *uart) if (uart->bits) ns16550_com1.data_bits = uart->bits; +#ifndef XEN setup_pcdp_irq(efi.hcdp, uart); /* Hide the HCDP table from dom0, xencons will be the console */ efi.hcdp = NULL; +#else + setup_pcdp_irq(__va(efi.hcdp), uart); + + /* Hide the HCDP table from dom0, xencons will be the console */ + efi.hcdp = EFI_INVALID_TABLE_ADDR; +#endif return 0; } @@ -227,9 +234,15 @@ efi_setup_pcdp_console(char *cmdline) struct pcdp_device *dev, *end; int i, serial = 0; +#ifndef XEN pcdp = efi.hcdp; if (!pcdp) return -ENODEV; +#else + if (efi.hcdp == EFI_INVALID_TABLE_ADDR) + return -ENODEV; + pcdp = __va(efi.hcdp); +#endif printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, __pa(pcdp)); diff --git a/xen/arch/ia64/xen/xensetup.c b/xen/arch/ia64/xen/xensetup.c index d6aa79c246..fc88e929c8 100644 --- a/xen/arch/ia64/xen/xensetup.c +++ b/xen/arch/ia64/xen/xensetup.c @@ -557,7 +557,8 @@ skip_move: /* process SAL system table */ /* must be before any pal/sal call */ - ia64_sal_init(efi.sal_systab); + BUG_ON(efi.sal_systab == EFI_INVALID_TABLE_ADDR); + ia64_sal_init(__va(efi.sal_systab)); /* early_setup_arch() maps PAL code. */ identify_vmx_feature(); diff --git a/xen/include/asm-ia64/linux-xen/linux/efi.h b/xen/include/asm-ia64/linux-xen/linux/efi.h index aeb349c7d5..451bbd16e1 100644 --- a/xen/include/asm-ia64/linux-xen/linux/efi.h +++ b/xen/include/asm-ia64/linux-xen/linux/efi.h @@ -256,7 +256,6 @@ struct efi_memory_map { */ extern struct efi { efi_system_table_t *systab; /* EFI system table */ -#ifndef XEN unsigned long mps; /* MPS table */ unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ unsigned long acpi20; /* ACPI table (ACPI 2.0) */ @@ -265,16 +264,6 @@ extern struct efi { unsigned long boot_info; /* boot info table */ unsigned long hcdp; /* HCDP table */ unsigned long uga; /* UGA table */ -#else - void *mps; /* MPS table */ - void *acpi; /* ACPI table (IA64 ext 0.71) */ - void *acpi20; /* ACPI table (ACPI 2.0) */ - void *smbios; /* SM BIOS table */ - void *sal_systab; /* SAL system table */ - void *boot_info; /* boot info table */ - void *hcdp; /* HCDP table */ - void *uga; /* UGA table */ -#endif efi_get_time_t *get_time; efi_set_time_t *set_time; efi_get_wakeup_time_t *get_wakeup_time; -- 2.30.2